<div id="admin_icon_edit">
<li><?php echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl.'/images/icons/icon_add2.png','',array('class' => 'add_button')).'<b>Upload New Image</b>', array("slide/create/modelName/$modelName/modelId/$modelId"));?></li>

</div>
  <div id="text_size">*Image size 531x315 (pixel) is best view</div>
  <?php
  $this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$dataProvider,
    'columns'=>array(
      array(
        'header'=>'No.',
        'value'=>'$row+1',
      ),
      array(
        'name'=>'Thumbnail',
        'type'=>'image',
        'value'=> 'Yii::app()->request->baseUrl.$data->thumbnailPath',
      ),
      array(
        'header' => 'Display Order',
        'class'=>'CButtonColumn',
        'template'=>'{up} {down}',
        'buttons' => array(
          'up' => array
          (
            'label'=>'up image',
            'visible'=>'$data->display_order > 1',
            'imageUrl'=>Yii::app()->request->baseUrl.'/images/icons/icon_up.png',
            'url'=>'Yii::app()->createUrl("slide/upPhoto", array("id"=>$data->id))',
          ),
          'down' => array
          (
            'label'=>'down image',
            'visible'=>'$data->display_order < $data->maxDisplayOrder',
            'imageUrl'=>Yii::app()->request->baseUrl.'/images/icons/icon_down.png',
            'url'=>'Yii::app()->createUrl("slide/downPhoto", array("id"=>$data->id))',
          ),
        )
      ),
      array(
        'header'=>'Enable',
        'class'=>'CButtonColumn',
        'template'=>'{enable} {disable}',
        'buttons'=>array(
          'enable' => array(
            'imageUrl' => Yii::app()->request->baseUrl.'/images/icons/icon_enable.jpg',
            'visible'=>'$data->enable == true',
            'url'=>'Yii::app()->createUrl("slide/updateStatus", array("id"=>$data->id))',
            'click'=>'function(){if (confirm("Do you want to disable this photo?")){return true; }else { return false;}}',
          ),
          'disable' => array(
            'imageUrl' => Yii::app()->request->baseUrl.'/images/icons/icon_disable.jpg',
            'visible'=>'$data->enable == false',
            'url'=>'Yii::app()->createUrl("slide/updateStatus", array("id"=>$data->id))',
            'click'=>'function(){if (confirm("Do you want to enable this photo?")){return true; }else { return false;}}',
          )
        ),
      ),
      /*
      array(
        'header'=>'Edit',
        'class'=>'CButtonColumn',
        'template'=>'{update}',
        'buttons'=>array(
          'update' => array(
            'imageUrl'=>Yii::app()->request->baseUrl.'/images/icons/icon_edit.jpg',
          )
        ),
      ),*/
      array(
        'header'=>'Delete',
        'class'=>'CButtonColumn',
        'template'=>'{delete}',
        'buttons'=>array(
          'delete' => array(
            'imageUrl'=>Yii::app()->request->baseUrl.'/images/icons/icon_bin.jpg',
          )
        ),
      ),
    ),
)); ?>
  
    <?php 
    if ($modelId!=0) {
    echo CHtml::link('Back to '. $modelName, array($modelName.'/list'));
    }
    ?>
